<%@ page import="top.lionkliu.utils.SystemConstants" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8" %>
<html>
<head>
    <title>用户信息</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link rel="stylesheet" href="../static/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="../static/bootstrap/css/bootstrap.min.css">
    <script src="../static/js/jquery.js"></script>
    <script src="../static/bootstrap/js/bootstrap.js"></script>
</head>
<body>
<%@include file="../common/NavBar.jsp" %>


<div class="shadow p-3 mb-5 rounded" style="width: 500px;height: auto;background-color: #cce5ff;margin: 50px;margin-left: 400px;">
    <h5 class="card-title">用户信息</h5>
    <div class="alert alert-primary" >
        <form action="<c:url value="/UploadServlet"/>" enctype="multipart/form-data" name="form" method="post">
            <div class="img" style="margin: 10px">
                <img src="<%=loginUser.getImage()%>" width="100" height="100" style="border-radius:50%;float: left"/>
            </div>
            <div class="right" style="margin-left: 150px">
                <div class="form-group row">
                    <div class="col-sm-10">
                        <input type="file" class="form-control" id="img" name="imgName">
                    </div>
                </div>
                <button type="submit" class="btn btn-primary">保存并上传头像</button>
            </div>
        </form>
    </div>
    <div class="alert alert-primary">
        用户名：<%=loginUser.getName()%><br>
        <%
            String identity=null;
            if (loginUser.getFlag().equals(SystemConstants.IS_ADMIN)) {
                identity="管理员";
            }else {
                identity="普通用户";
            }
        %>
        身份：<%=identity%><br>
        邮箱：<%=loginUser.getEmail()%><br>
        密码：<%=loginUser.getPassword()%><br>
    </div>
</div>

</body>
</html>
